﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SSPharma.Model;
using System.Data.Common;
using SSPharma.Common;

namespace SSPharma.Biz.HeThong
{
    class BizImportExcel
    {
        /// <summary>
        /// User: TAMNN 31/07/2014
        /// Mục đích: lấy điều kiện import
        /// </summary>
        /// <returns></returns>
        public IList<cboCommon> fl_DSDanhMuc_cboCommon()
        {
            List<cboCommon> items = new List<cboCommon>();
            cboCommon item;
            StringBuilder strSQL = new StringBuilder(300);
            strSQL.Append("SELECT MacboCommon,TencboCommon");
            strSQL.Append(" FROM HT_DM_cboCommon");
            strSQL.Append(" ORDER BY ID_SQ");
            using (DbDataReader dataReader = Global.DataFactory.Reader(strSQL.ToString()))
            {
                if (dataReader.HasRows)
                {
                    while (dataReader.Read())
                    {
                        item = new cboCommon();
                        item.Id = dataReader.IsDBNull(0) ? string.Empty : dataReader.GetString(0);
                        item.Name = dataReader.IsDBNull(1) ? string.Empty : dataReader.GetString(1);
                        items.Add(item);
                    }
                }
            }
            return null;
        }
    }
}
